<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>IupDatePick</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
<style type="text/css">
.style1 {
	border-width: 0;
}
.auto-style1 {
	font-size: large;
}
</style>
</head>
<body>
<div id="navigation">
  <ul>
    <li><a href="#Creation">Creation</a></li>
    <li><a href="#Attributes">Attributes</a></li>
    <li><a href="#Callbacks">Callbacks</a></li>
    <li><a href="#Notes">Notes</a></li>
    <li><a href="#Examples">Examples</a></li>
    <li><a href="#SeeAlso">See Also</a></li>
  </ul>
</div>

<h2>IupDatePick<span class="auto-style1"> (since 3.17)</span></h2>

  <p>
  Creates a date editing interface element, which can displays a calendar for 
  selecting a date.</p>
<p>
  In Windows is a native element. In GTK and Motif is a custom element. In Motif 
  is not capable of displaying the calendar.</p>

<h3><a name="Creation">Creation</a></h3>
<pre>Ihandle* IupDatePick(); [in C]
iup.datepick{} -&gt; (<strong>ih</strong>: ihandle) [in Lua]
datepick() [in LED]</pre>
  <p>
  <u>Returns:</u> the identifier of the 
  created element, or NULL if an error occurs.</p>

<h3><a name="Attributes">Attributes</a></h3>


<p><strong>CALENDARWEEKNUMBERS</strong>: Shows the number of the week along the 
year in the calendar. Default: NO.</p>
<p><strong>FORMAT</strong> [Windows Only]: Flexible format for the date in 
Windows. For more information see
<a href="https://msdn.microsoft.com/EN-US/library/windows/desktop/bb761726(v=vs.85).aspx" target="_top">
&quot;About Date and Time Picker Control&quot;</a> in the Windows SDK. The Windows control 
was configured to display date only without any time options. Default: &quot;d'/'M'/'yyyy&quot;. 
See Noted bellow.</p>
<p><strong>MONTHSHORTNAMES</strong> [Windows Only]: Month display will use a 
short name instead of numbers. Must be set before ORDER. Default: NO. Names will 
be in the language of the system.</p>
<p><strong>ORDER</strong>: Day, month and year order. Can be any combination of 
&quot;D&quot;, &quot;M&quot; and &quot;Y&quot; without repetition, and with all three letters. It will set the 
FORMAT attribute in Windows. It will NOT affect the VALUE attribute order. 
Default: &quot;DMY&quot;. </p>
<p><strong>SEPARATOR</strong>: Separator between day, month and year. Must be 
set before ORDER in Windows. Default: &quot;/&quot;.</p>
<p><b>
  SHOWDROPDOWN</b> (write-only): opens or closes the dropdown calendar. Can be
  "YES" or
  "NO". Ignored if set before map. In Windows, it works only for NO. (since 
3.28)</p>

  
<p><strong>TODAY</strong> (read-only): Returns the date corresponding to today 
in VALUE format.</p>
<p><strong>VALUE</strong>: the current date always in the format 
&quot;year/month/day&quot; (&quot;%d/%d/%d&quot; in C). Can be set to &quot;TODAY&quot;. Default value is the 
today date.</p>
<p><strong>ZEROPRECED</strong>: Day and month numbers will be preceded by a 
zero. Must be set before ORDER in Windows. Default: No.</p>
<h3><a name="Callbacks">Callbacks</a></h3>

  
  
<p><strong>VALUECHANGED_CB</strong>:
  Called after the value was interactively changed by the user.</p>

<pre>int function(Ihandle *<strong>ih</strong>); [in C]<br><strong>ih</strong>:valuechanged_cb() -&gt; (<strong>ret</strong>: number) [in Lua]</pre>

    
<p class="info"><strong>ih</strong>:
  identifier of the element that activated the 
  event.</p>

<blockquote>
  
  <hr>
</blockquote>


<p><a href="../call/iup_map_cb.html">MAP_CB</a>,  
<a href="../call/iup_unmap_cb.html">UNMAP_CB</a>, 
<a href="../call/iup_destroy_cb.html">DESTROY_CB</a>, 
<a href="../call/iup_getfocus_cb.html">GETFOCUS_CB</a>,
  <a href="../call/iup_killfocus_cb.html">KILLFOCUS_CB</a>, 
<a href="../call/iup_enterwindow_cb.html">ENTERWINDOW_CB</a>,
  <a href="../call/iup_leavewindow_cb.html">LEAVEWINDOW_CB</a>, 
<a href="../call/iup_k_any.html">K_ANY</a>,
  <a href="../call/iup_help_cb.html">HELP_CB</a>: All common callbacks are 
supported.&nbsp;</p>

<h3><a name="Notes">Notes</a></h3>

<p>In GTK uses a custom control built with IUP elements, 
and in Windows uses DATETIMEPICK_CLASS.</p>

<p>In Windows, when the user navigates to other pages in the calendar the date is 
not changed until the user actually selects a day.</p>
<p>In Windows, FORMAT can have the following values, but <span>other text in the 
format string must be enclosed in single quotes:</span></p>
<p class="info">
<table responsive="true">
	<tr>
		<th>Element</th>
		<th>Description</th>
	</tr>
	<tr>
		<td data-th="
    Element
    ">&quot;d&quot;</td>
		<td data-th="
    Description
    ">The one- or two-digit day. (<strong>default</strong>)</td>
	</tr>
	<tr>
		<td data-th="
    Element
    ">&quot;dd&quot;</td>
		<td data-th="
    Description
    ">The two-digit day. Single-digit day values are preceded by a zero.<br>(Set 
		when ZEROPRECED=Yes)</td>
	</tr>
	<tr>
		<td data-th="
    Element
    ">&quot;ddd&quot;</td>
		<td data-th="
    Description
    ">The three-character weekday abbreviation.</td>
	</tr>
	<tr>
		<td data-th="
    Element
    ">&quot;dddd&quot;</td>
		<td data-th="
    Description
    ">The full weekday name.</td>
	</tr>
	<tr>
		<td data-th="
    Element
    ">&quot;M&quot;</td>
		<td data-th="
    Description
    ">The one- or two-digit month number. (<strong>default</strong>)</td>
	</tr>
	<tr>
		<td data-th="
    Element
    ">&quot;MM&quot;</td>
		<td data-th="
    Description
    ">The two-digit month number. Single-digit values are preceded by a zero.<br>
		(Set when ZEROPRECED=Yes)</td>
	</tr>
	<tr>
		<td data-th="
    Element
    ">&quot;MMM&quot;</td>
		<td data-th="
    Description
    ">The three-character month abbreviation.<br>(Set when MONTHSHORTNAMES=Yes)</td>
	</tr>
	<tr>
		<td data-th="
    Element
    ">&quot;MMMM&quot;</td>
		<td data-th="
    Description
    ">The full month name.</td>
	</tr>
	<tr>
		<td data-th="
    Element
    ">&quot;yy&quot;</td>
		<td data-th="
    Description
    ">The last two digits of the year (that is, 1996 would be displayed as 
		&quot;96&quot;).<br>(Not recommended)</td>
	</tr>
	<tr>
		<td data-th="
    Element
    ">&quot;yyyy&quot;</td>
		<td data-th="
    Description
    ">The full year (that is, 1996 would be displayed as &quot;1996&quot;). (<strong>default</strong>)</td>
	</tr>
</table>
</p>

<h3><a name="Examples">Examples</a></h3>


<table align="center">

	<tbody>
    <tr>

		<th><br>Windows <br>

		Classic</th>

		<th>Windows <br>

		w/ Styles</th>

		<th>GTK</th>

	</tr>

	<tr>

		<td class="bg_win2k"><img src="images/iupdatepick_win2k.png"></td>

		<td class="bg_winxp"><img src="images/iupdatepick_winxp.png"></td>

		<td class="bg_gtk"><img src="images/iupdatepick_gtk.png"></td>

	</tr>
	
	<tr>

		<td class="bg_win2k"><img src="images/iupdatepick_win2k_open.png"></td>

		<td class="bg_winxp"><img src="images/iupdatepick_winxp_open.png"></td>

		<td class="bg_gtk"><img src="images/iupdatepick_gtk_open.png"></td>

	</tr>

	
  </tbody>
</table>


<p><a href="../../examples/">Browse for Example Files</a></p>
<h3><a name="SeeAlso">See Also</a></h3>

<p> <a href="iupcalendar.html">IupCalendar</a>.</p>


</body>

</html>